import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] =  [
  {
    title: '排产编号',
    align:"center",
    dataIndex: 'productScheduleNo'
  },
  {
    title: '投入品名称',
    align:"center",
    dataIndex: 'name'
  },

  {
    title: '俗称',
    align:"center",
    dataIndex: 'popularName'
  },
  {
    title: '投入品种类',
    align:"center",
    dataIndex: 'input_dictText'
  },
  {
    title: '生产厂家',
    align:"center",
    dataIndex: 'manufacturer'
  },
  {
    title: '出厂日期',
    align:"center",
    dataIndex: 'productionDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
  },
  // {
  //   title: '保质期',
  //   align:"center",
  //   dataIndex: 'qualityPeriod'
  // },
  // {
  //   title: '作业记录编号',
  //   align:"center",
  //   dataIndex: 'opId'
  // },
  {
    title: '计划投入量',
    align:"center",
    dataIndex: 'actualUsage'
  },
  {
    title: '实际用量',
    align:"center",
    dataIndex: 'dosage'
  },
  {
    title: '作业时间',
    align:"center",
    dataIndex: 'time',
    width: 180
  },
  {
    title: '作业人',
    align:"center",
    dataIndex: 'createBy',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] =  [
  {
    label: "投入品名称",
    field: 'name',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "投入品种类",
    field: 'input',
    component: 'JDictSelectTag',
    colProps: {span: 6},
    componentProps: {
      dictCode: 'input',
      placeholder: '请选择投入品种类',
    },
  },
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
